package com.feihong.txgw.tx_model;

import com.feihong.txgw.inter.contract.recharge.RechargeContract;
import com.feihong.txgw.json.recharge.PhoneLocationInfo;
import com.feihong.txgw.utils.helper.RxHelper;
import com.feihong.txgw.utils.manage.RetrofitManager;

import io.reactivex.Observable;

/**
 * @Author wangziheng
 * @ProjectName txgw_app
 * @ClassName RechargeMainModel
 * @package com.feihong.txgw.tx_model
 * @data 2018/5/7 11:27
 * @Describe
 * @Change
 */
public class RechargeMainModel implements RechargeContract.IRechargeMainModel {

    public static RechargeMainModel create(){
        return new RechargeMainModel();
    }
    @Override
    public Observable<PhoneLocationInfo> getOperators(String rechargeType, String rechargeTel) {
        return RetrofitManager.getInstance().getTelOperators(rechargeType,rechargeTel).compose(RxHelper.<PhoneLocationInfo>rxSchedulerHelper());
    }

    @Override
    public Observable<String> submitRechargeOrder(String chargeType, String chargeTel, String terminalType, String goodsID) {
        return RetrofitManager.getInstance().submitRechargeOrder(chargeType,chargeTel,terminalType,goodsID).compose(RxHelper.<String>rxSchedulerHelper());
    }
}
